<?php header("Content-Type: text/html; charset=utf-8"); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>登录 | 木篱笆书站后台登录</title>
<link href="../resources/css/admin/backstyle.css" type="text/css"  rel="stylesheet" />
<script src="../resources/js/jquerys/lib/jquery.js" type="text/javascript"></script>
<script src="../resources/js/jquerys/lib/jquery.cookie.js" type="text/javascript"></script><!--cookie-->
<script type="text/javascript">
	$(document).ready(function(){
		var u = $.cookie("phpUser");
		var p = $.cookie("phpPwd");
		if(u!=null && u!=""){
			$("#userName").val(u);
			$("#rememberup").attr("checked",true);
		}
		if(p!=null && p!=""){
			$("#pwd").val(p);
			$("#rememberup").attr("checked",true);
		}

		$(".login_btn").click(function(){
			var rememberup = $("#rememberup");
			if(rememberup.attr("checked") == true){
				$.cookie("phpUser",$("#userName").val(),{ expires: 30 });
				$.cookie("phpPwd",$("#pwd").val(),{ expires: 30 });
			}else{
				$.cookie("phpUser",null);
				$.cookie("phpPwd",null);
			}
			$("#login_form").submit();
		});
	});
</script>
</head>

<body>
<div class="login">
	<h2>木篱笆书站 </h2>
    <form action="checkLogin.php" method="post" id="login_form">
    	<label class="login_label">用户名</label>
        <input type="text" name="userName" class="login_input" id="userName" />
        <label  class="login_label">密码</label><br/>
        <input type="password" name="pwd" class="login_input" id="pwd" />
        <input type="checkbox" name="rememberup" value="1" id="rememberup" />记住登录信息
        <input type="button" name="btn" class="login_btn" value="登录"/>
     </form>

	 <p id="nav">
		 <a href="#" title="忘记密码">忘记密码</a>
	 </p>
</div>

</body>

</html>
<?php 
$error = $_GET["errorId"];
if($error!=null){
	if($error=="0"){
		echo "<script type='text/javascript'> alert('没有登录，请登录！');</script>";
	}else if($error=="1"){
		echo "<script type='text/javascript'> alert('用户名或密码不正确！');</script>";
	}else{
		echo "<script type='text/javascript'> alert('请重新登录！');</script>";
	}
}
?>
